﻿
var num = 0;
var page = 1;
var keyword = ""; //关键词
var hannelid = ""; //频道id
var authid = "1"; //作者id
var hid = "";



$(document).ready(function () {
    var shareid = "";
    shareid = getUrlArgStr("Shareid");
    var articleid = getUrlArgStr("advertid");
    var id = shareid == "" ? articleid : shareid;
    var type = getUrlArgStr("type")
    $("#type").val(type);
    $("#Shareid").val(id);
    if (getUrlArgStr("summny") == "wap") {
        summny()
    }
    else {
        summload(shareid, articleid);
    }

    $(".topright").click(function () {
        window.location.href = "Statistical.html?summny=wap";
    });
});

function summny() {
    $("#title").html("微街秀 > 广告汇总");
    $(".topcententxt").html("广告汇总");
    $(".topright").css("display", "none");
    summload("", "");
}
function summload(shareid, articleid) {
    if (!islogin()) { window.location.href = 'login.html'; return; }
    ajax.GetCount("shared_id=" + shareid + "&advert_id=" + articleid, function (data) {
 
        if (data.msg.toString() == "成功") {
 
            $("#ac").html(data.item[0].ac);
            $("#ac_day").html(data.item[0].ac_day);
            $("#ac_month").html(data.item[0].ac_month);

            $("#sc").html(data.item[0].sc);
            $("#sc_day").html(data.item[0].sc_day);
            $("#sc_month").html(data.item[0].sc_month);
        }

    });

}

function clickdetail(day) {
    if ($(".topright").css("display") == "none") {
        window.location.href = "RecordClick.html?type=" + $("#type").val() + "&day=" + day + "&id=";
    }
    else {
        window.location.href = "RecordClick.html?type=" + $("#type").val() + "&day=" + day + "&id=" + $("#Shareid").val();
    } 
}
function querydetail(day) {
    if ($(".topright").css("display") == "none") {
        window.location.href = "RecordQuery.html?type=" + $("#type").val() + "&day=" + day + "&id=";
     }
    else {
        window.location.href = "RecordQuery.html?type=" + $("#type").val() + "&day=" + day + "&id=" + $("#Shareid").val();
    } 
}